<template>
  <j-modal title="退诊信息" :width="800" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk"
    >
    <div class="box">
      <p><span>门诊地区：</span>{{ infoObj.regionWords }}</p>
      <p><span>门诊名称：</span>{{ infoObj.clinicName }}</p>
      <p><span>病人编号：</span>{{ infoObj.patientId }}</p>
      <p><span>入组时间：</span>{{ infoObj.groupTime }}</p>
      <p><span>退出时间：</span>{{ infoObj.quitTime }}</p>
      <p><span>退出原因：</span>{{ setTittle(infoObj.quitReason) }}</p>
      <p><span>填表日期：</span>{{ infoObj.fillFormTime }}</p>
      <p><span>医生编号：</span>{{ infoObj.doctorId }}</p>
    </div>
    <template slot="footer">
      <p style="text-align: left;">创建人：{{ infoObj.createBy }} <span style="margin-left:30px;">创建时间：{{ infoObj.createTime
      }}</span> </p>
    </template>
  </j-modal>
</template>
<script>
import * as treatApi from '@/api/sjsk/help/treat.js'
export default {
  name: 'detailModal',
  data() {
    return {
      visible: false,
      infoObj: {},
    }
  },
  async created() {
  },
  methods: {
    show(record) {
      this.visible = true
      // this.getDetail(id)
      this.infoObj = record
    },
    getDetail(id) {
      treatApi.getWithdrawalByPid({ patientId: id }).then(res => {
        if (res.success) {
          this.infoObj = res.result
        }
      })
    },
    setTittle(text) {
      return this.$filterDictTextByCache('quitClinicReason', text)  //现在字典中对应的文字，是全局函数
    },
    handleCancel() {
      this.visible = false
    },
    handleOk() {
      this.visible = false
    }
  },
}
</script>
<style lang="less" scoped>
.box {
  span {
    display: inline-block;
    width: 90px;
    text-align: left;
  }
}
</style>
